<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="jt.classic.system.group.IGroup"%>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.HTMLTool"%>
<%@ page import="org.limp.mine.Controller"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%@ page import="jt.classic.system.wordbook.XWordbook"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[]) request.getAttribute("result");
	Label label = (Label) result[1];
	Controller controller = (Controller) result[2];
	String pageNO = (String) result[3];
	List resultList = (List) result[0];

	Map query = (Map) request.getAttribute("query");

	List list = (List) request.getAttribute("list");

	/*列表类型*/
	String listtype = "directory";//(String)request.getAttribute("listtype");

	String qname = (String) query.get("qname");
	String qtype = (String) query.get("qtype");
	String qdirec = (String) query.get("qdirec");
	String qdirecid = (String) query.get("qdirecid");
	String qstatus = (String) query.get("qstatus");
	String qdate = (String) query.get("qdate");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>信息浏览痕迹列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../head.jsp"></jsp:include>
<link rel="stylesheet" type="text/css" href="<%=context%>/app/info/css/directree.css" />
<script type="text/javascript" src="<%=context%>/app/info/js/lanmuselect.js"></script>
<script language="javascript">
  var chk = false;
  function checkall(thizz){
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox"){
        chks[i].checked = !chk;
      }
    }
    
    chk = !chk;
  }
  
  function handleDeletes(){
    var rnt = false;
    var ids = "";
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox" && chks[i].checked){
        rnt = true;
        ids += chks[i].value + ",";
      }
    }
    
    if(!rnt){
      alert("请选择要删除的记录");
    }else if(confirm("确定删除")){
      createHidden("ids",ids.substring(0,ids.length - 1));
      document.form1.action = "<%=context%>/app/infotrace.do?method=delete";
      document.form1.submit();
    }
  }
  
  function handleQuery(){
      document.form1.action = context + "/app/infotrace.do?method=list";
      document.form1.submit();
  }
</script>
<body>
<form id="form2" name="form1" method="post" action="">
<input type="hidden"
	name="pageNO" value="<%=pageNO%>">
                <h2>
				信息管理 - 浏览记录
				</h2>
				<div align="left" style="padding:5px;">
				<span id="qdirecarea"><%if(!qdirec.equals("")){ %>所属栏目 : <%=qdirec%><%} %></span>&nbsp;
				<img src="<%=context %>/app/info/images/search.png" title="查询浏览记录" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:queryInfo(true);"/>
				<img src="<%=context %>/app/info/images/page_white_delete.png" title="删除浏览记录" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleDeletes();"/>
				<input type="hidden" id="qdirec" name="qdirec" value="<%=qdirec%>"/>
				<input type="hidden" id="qdirecid" name="qdirecid" value="<%=qdirecid%>"/>
				<input type="hidden" id="qname" name="qname" value="<%=qname%>"/>
				<input type="hidden" id="qstatus" name="qstatus" value="<%=qstatus %>"/>
				<input type="hidden" id="qdate" name="qdate" value="<%=qdate%>"/>
				</div>
				<table class="tbl" align="center" width="98%">
					<thead>
					<tr>
						<td align="center" title="全部选择/取消选择" onclick="javascript:checkall();">选择</td>
						<td 
							width="35%" align="center">&nbsp;<font color="#4C4C4C"><b>内容信息</b></font></td>
						<td 
							width="15%" align="center">&nbsp;<font color="#4C4C4C"><b>浏览者</b></font></td>
						<td 
							width="15%" align="center">&nbsp;<font color="#4C4C4C"><b>IP</b></font></td>
						<td 
							width="25%" align="center">&nbsp;<font color="#4C4C4C"><b>浏览时间</b></font></td>
					</tr>
					</thead>
					<tbody>
					<%
							if (resultList != null && !resultList.isEmpty()) {
							for (int i = 0; i < resultList.size(); i++) {
								Map info = (Map) resultList.get(i);
								String number = (String) info.get("PAGINATION_NUMBER");
								String title = HTMLTool.htmlEscape((String) info.get("O_NAME"));
								String ip = (String) info.get("O_IP");
								String date = (String) info.get("O_DATE");
								String username = (String) info.get("O_USERNAME");
								String id = (String) info.get("PK_ID");
								String ifid = (String) info.get("O_ID");
					%>
					<tr onMouseOver="javascript:this.bgColor='#ffff99'"
						onmouseout=" javascript:this.bgColor='#ffffff'" >
						<td align="center" valign="top"><input type="checkbox" name="chk" value="<%=id%>">&nbsp;<%=number%>
						</td>
						<td><div class="listtitle" style="width:300px;" title="<%=title%>"><%=title %></div></td>
						<td align="center">&nbsp;<%=username%></td>
						<td align="center"><%=ip%></td>
						<td align="center">&nbsp;<%=DateTrimmer.getYMDHMS_LBL(date)%></td>
					</tr>
					<%
						}
						}
					%>
					</tbody>
				</table>
				<div id="pager"><div style="float:left;padding:5px;"><%=label.displayLabel()%>
					</div> <div style="float:right;padding:5px;"><%=label.startLabel()%> <%=label.previousLabel()%>
						<%=label.nextLabel()%> <%=label.endLabel()%> 
				<%=controller.getController().toString()%></div>
				</div>
				<%=controller.getControlScript(true)%>
</form>
</body>
</html>
